<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned()->comment('用户id，关联users表id');
            $table->char('user_name',20)->comment('用户名, 关联users表name');
            $table->string('route')->comment('路由');
            $table->char('method', 4)->comment('请求方式');
            $table->text('params')->comment('请求参数');
            $table->string('ip', 15)->comment('请求IP');
            $table->timestamp('time');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users_log');
    }
}
